define(["jquery", "easy-admin"], function ($, ea) {


var url = 'group/user/index';
if(gfid != "-1"){
    url = 'group/user/index?filter=%7B%22groupid%22%3A%22'+gfid+'%22%7D&op=%7B%22groupid%22%3A%22%25*%25%22%7D';
}

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: url,
        add_url: 'group/user/add',
        edit_url: 'group/user/edit',
        delete_url: 'group/user/delete',
        export_url: 'group/user/export',
        modify_url: 'group/user/modify',
        sendqz_url:'group/user/sendqz',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                toolbar:['refresh','export'],
                cols: [[
                    {type: 'checkbox'},
                    //{field: 'id', title: 'ID',search: false},
                    //{field: 'groupid', title: '群ID',search: false,},
                    //{field: 'userid', title: 'ID',search: false,},
                    {field: 'user', title: '用户',search: false},
                    {field: 'zt', title: '群封禁状态',templet: ea.table.switch,search: false},
                    {
                        width: 250,
                        title: '操作',
                        templet: ea.table.tool,
                        operat: [
                            [{
                                text: '设群主',
                                url: init.sendqz_url,
                                method: 'request',
                                auth: 'stock',
                                class: 'layui-btn layui-btn-xs layui-btn-normal',
                            }]]
                    }
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});